package com.xiongwei.iterator;

import java.util.Iterator;

/**
 * @author XiongWei
 * @date 2024/2/20
 */
public class ComputerCollege implements College {

    Department[] departments;
    int position = 0;

    public ComputerCollege() {
        this.departments = new Department[]{
                new Department("计算机科学与技术", "计算机科学与技术"),
                new Department("软件工程", "软件工程"),
                new Department("网络工程", "网络工程")
        };
    }

    @Override
    public String getName() {
        return "计算机学院";
    }

    @Override
    public void addDepartment(String name, String desc) {
        departments[position++] = new Department(name, desc);
    }

    @Override
    public Iterator createIterator() {
        return new ComputerCollegeIterator(departments);
    }
}
